package com.jblapp.icu.sms;

import com.jblapp.icu.ui.RegisterConfirmActivity;

import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.Log;

public class SendSmsThread implements Runnable {
	private Context context = null;
	private Handler msgHandler = null;
	private String phoneNumber = null;
	private String textMsg = null;
	private SmsUtils smsUtils = null;
	private Message msg = null;
	private final static String TAG = "SendSmsThread";

	public SendSmsThread(Context context, Handler msgHandler,
			String phoneNumber, String textMsg) {
		this.context = context;
		this.msgHandler = msgHandler;
		this.phoneNumber = phoneNumber;
		this.textMsg = textMsg;
	}

	@Override
	public void run() {
		smsUtils = new SmsUtils(context);
		smsUtils.sendSmsMsg(phoneNumber, textMsg);
		Log.e(TAG, textMsg);
		msg = new Message();
		msg.what = RegisterConfirmActivity.SENT_SMS;
		msgHandler.sendMessage(msg);
	}

}
